<template>
  <div id="app">
    <RouterView/>
  </div>
</template>

<script>
import {RouterView} from "vue-router";

export default {
  data() {
    return {
      hasLogin: false
    }
  },
  name: 'App',
  components: {
    RouterView
  },
  mounted() {
    const loginUser = this.$loginSession(true);
    if (loginUser.username) {
      this.hasLogin = true;
    }
    if (this.hasLogin) {
      this.$router.push({path:'/index'})
    }else {
      this.$router.push({path:'/'})
    }
  }
}
</script>

<style>
html,body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}
#app {
  height: 100%;
}
</style>
